import http from '@/utils/request'

export const setUserChannels = (channels) => {
    return {
        type: 'home/channel',
        payload: channels,
    }
}

export const getUserChannels = () => {
    return async (dispatch) => {
        const res = await http.get('user/channels')
        const { channels } = res.data
        dispatch(setUserChannels(channels))
    }
}